import trunk from '../mock/trunk';
import Mock from 'mockjs';
import { createPromise } from '../util';
import request from '../request.js';
const { highPrecisionMapPlatformUrl } = window.g;
/** 路口综合指标 */
export const congestion = (data) => {
  return createPromise(Mock.mock(trunk['congestion']));
}

/** 平均通行速度 */
export const speed = (data) => {
  return createPromise(Mock.mock(trunk['speed']));
}


/** 平均车辆密度 */
export const density = (data) => {
  return createPromise(Mock.mock(trunk['density']));
}


/** 异常告警 */
export const warning = (data) => {
  return createPromise(Mock.mock(trunk['warning']));
}


/** 平均通行时间 */
export const time = (data) => {
  return createPromise(Mock.mock(trunk['time']));
}


/** 平均停车次数 */
export const stop = (data) => {
  return createPromise(Mock.mock(trunk['stop']));
}


/** 交通流量、饱和度、均衡度信息 */
export const overview = (data) => {
  return createPromise(Mock.mock(trunk['overview']));
}


/** 获取干线列表 */
export const getTrunkList = (url) => request({
  url,
  method: 'GET'
});

/**干线拥堵情况 */
export const trunkCongestionDetail = (data) => request({
  url: `${highPrecisionMapPlatformUrl}/dynamicMapService/queryCongestionSituationHistoryData`,
  method: 'POST',
  data
});